package com.hospital.workstation.utils;

import cn.hutool.core.lang.Console;
import cn.hutool.crypto.digest.DigestUtil;
import cn.hutool.crypto.digest.MD5;

/**
 * @ClassName MD5Util
 * @description: MD5加密
 * @author: whb
 * @create: 2023-04-10 15:18
 * @Version 1.0
 **/
public class MD5Util {
    private static String nid = "1013";
    /**
     * 密匙
     */
    private static String secret = "D01CD6037D7F4E0C8447913292FB833K";

    /**
     * MD5运算
     * @param zyh 住院号
     * @param rycs 入院次数
     * @param bqdm 病区代码
     * @return 签名信息
     */
    public static String getMd5(String zyh, String rycs, String bqdm) {
        String str = bqdm + nid + rycs + zyh + secret;
        return DigestUtil.md5Hex(str);
    }

    public static void main(String[] args) {
        Console.log(getMd5("20789719","40","H103400200"));
    }
}
